Host devices such as computers, laptops, personal video recorders (PVRs), MP3 players, game consoles, servers, set-top boxes, digital cameras, and/or other electronic devices often need to store a large amount of data. Storage devices such as hard disk drives (HDD) may be used to meet these storage requirements.
A hard disk controller (HDC) communicates with the storage device and the host system. The HDC manages interaction between the storage device and the host system. Communication between the host system and the HDC is usually provided using one of a variety of standard I/O bus interfaces. Typically, when data is read from a storage device, a host system sends a read command to the HDC, which stores the read command into a buffer memory. Data is read from the storage device and stored in the buffer memory.
A conventional controller stores data bytes on the storage device in sets of a predetermined length. The HDC or a host may generate error correction code (ECC) bytes and cyclic redundancy checks (CRC) bytes for each set of data bytes. For example, the host may generate data bytes, and the HDC may generate a distinct set of CRC and/or ECC bytes. CRC and ECC information is used to reliably recover the data bytes from the storage device. Typically, CRC and/or ECC bytes are computed when data bytes are transmitted from the HDC to the storage device. The CRC and the ECC bytes are appended to the end of the set of data bytes. The data bytes, ECC bytes, and/or CRC bytes constitute a sector of data that is stored to the storage device.
Errors can occur when data bytes are transmitted from the HDC and stored to the storage device. An ECC module detects and corrects errors in the sector as the sector is read from the storage device.